package com.spring.bean.example;

import org.apache.lucene.document.Field.Index;
import org.apache.lucene.document.Field.Store;

import com.spring.annotation.entity.Table;
import com.spring.annotation.search.Searchable;
import com.spring.annotation.search.SearchableProperty;
import com.spring.bean.Entity;

/*
 * @Searchable(root=false)->声明该搜索实体不是单独存在的，而是作为book类的一部分
 */
@Table(name="sort")
@Searchable(name="sort", root=false)
public class Sort extends Entity {
	
	// 不需要索引，需要存储
	@SearchableProperty(index=Index.NO, store=Store.YES, name="sortId")
	private Integer id;
	// Index.NOT_ANALYZED -> 不分词，但建立索引
	@SearchableProperty(index=Index.NOT_ANALYZED, store=Store.YES, name="sortName")
	private String name; // 分类名称
	private Integer num; // 分类序号
	private String remark; // 备注
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
